﻿using System.Web.Script.Serialization;
namespace Model
{
    /// <summary>
    /// 所有实体类都应该继承此类
    /// </summary>
    public abstract class BaseModel
    {
        private readonly JavaScriptSerializer _jss = new JavaScriptSerializer();
        /// <summary>
        /// 重写ToString方法，实体类输出格式为：{属性1：值1，属性2：值2...}
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return _jss.Serialize(this);
        }


    }
}
